﻿##########################################
#  Configure Thin Client 
#
#  Created By: Chris Towles - www.christowles.com
#  Version: 1.0
#
##########################################
Clear-Host
Set-ExecutionPolicy -Scope CurrentUser -executionPolicy Unrestricted -WarningAction SilentlyContinue

#This Share that stores the Network Powershell Scripts.
#They must already be configured.
$PowerShellUpdatesScript = "\\viewserv1.hh.nku.edu\ClientPSfiles\UpdateLocalScripts.ps1"  

Function Set-UserShell {
	
	#Clear the last user to login to View
	$key = "hkcu:\\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
	$name = "Shell" 
	$ShellValue = "powershell.exe -WindowStyle Hidden -Command `"& 'C:\Program Files\VMware\VMware View\PowerShellScripts\UpdateLocalScripts.ps1' thinclient`""
	Write-Host "Changing User's Shell to: $ShellValue"
	set-itemproperty -path $key -name $name -value $ShellValue 
}

#TODO
#setAutologin to local user
Set-UserShell  
Write-Host "Client Profile Setup Finished."